package com.softserveinc.edu.oms.persistence.dao.concrete;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;

import com.softserveinc.edu.oms.persistence.dao.HibernateDao;
import com.softserveinc.edu.oms.persistence.entities.Order;
import com.softserveinc.edu.oms.persistence.entities.OrderItem;

public class OrderItemDao extends HibernateDao<OrderItem> {

	public OrderItemDao(final SessionFactory sessionFactory) {
		super(OrderItem.class, sessionFactory);
	}

	public List<OrderItem> getOrderItemsFromOrder(final Order order) {

		return findByCriterions(Restrictions.eq("order", order));
	}
}
